<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>dom01</title>
    <script>
            //    匿名函数，访问Dom
            window.onload = function () {
                heading = document.createElement("h1");
                heading_text = document.createTextNode("Big Head!");
                heading.appendChild(heading_text);
                document.body.appendChild(heading);
            }
            
            window.onload = function() {
                const foo = document.getElementById('foo')
                let fooContent = foo.innerHTML
                console.log('document.getElementById(\'foo\') 得到： ' + foo)
                console.log('foo.innerHTML :' + fooContent)
                console.log( 'foo.nodeType ' + foo.nodeType)
                console.log( 'foo.nodeName ' + foo.nodeName)
                console.log( 'foo.nodeValue ' + foo.nodeValue)
                console.log( 'foo.firstChild.nodeValue ' + foo.firstChild.nodeValue)
            }

       
    </script>
</head>
<body>
        <h1 id="foo">HELLO WORLD</h1>
</body>
</html>